<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" 	uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" 	%> 

<jsp:useBean id="manager" 	class="chat.bean.ChatRoomManager" scope="request" />

<jsp:setProperty name="manager" 	property="*" /> 
<jsp:setProperty name="manager"		property="createChatRoom" value="${param.chatRoomName}" />

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Chat Room List </title>
</head>
<body> 
	<h3><a href="../index.html">첫 페이지</a></h3> 
	<div>
		<hr/>
		<h4> 
			채팅방 목록
		</h4> 
		<form method="POST" action="chatSend.jsp" target="_self" >
			<ol>
				<c:forEach items="${ manager.chatRoomList }" var="it" varStatus="status" >
					<li> 
						<button name="chatRoomId" value="${ it.chatRoomId}">입장</button> 
						[ ${ it.chatRoomDispName }	]
						[ ${ it.chatRoomUserName }		]
						[ <fmt:formatDate	  type="time" 	timeStyle="short" value="${ it.chatRoomCreDate }" /> ]
					</li>
				</c:forEach> 
			</ol> 
		</form>
	</div>
	
	<hr/>
	
	<form method="POST">
		<ul style="padding-left: 20px;">
			<li>
				<label for="chatRoomUserName" >아이디</label>
				<input type="text" name="chatRoomUserName" value="${ manager.chatRoomUserName }" />
			</li>
			<li>
				<label for="chatRoomName" >방제목</label>
				<input type="text" name="chatRoomName" value="" />
				<label> &nbsp; </label>
				<input type="submit" value ="방 만들기" />
			</li>
		</ul> 
	</form>
	
	<hr/>
	
</body>
</html>